<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <meta charset="UTF-8">
    <title>图书管理系统-个人信息</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}"/>
    <script type="text/javascript" th:src="@{/layui/layui.js}"></script>
    <script type="text/javascript" th:src="@{/js/lib/jquery-1.11.0.min.js}"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div th:replace="inc/top :: div"></div>
    <div th:replace="inc/left :: div"></div>
    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;" id="lay_body">
            <fieldset class="layui-elem-field">
                <legend>个人信息</legend>
                <div class="layui-field-box">
                    <form method="post" id="formId">
                        <input type="hidden" th:value="${user.id}" name="id" id="id"/>
                        <div class="layui-form-item">
                            <label class="layui-form-label">用户名</label>
                            <div class="layui-input-inline">
                                <input type="text" th:value="${user.username}" disabled="disabled" name="username" required lay-verify="required"  autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">姓名</label>
                            <div class="layui-input-inline">
                                <input type="text" th:value="${user.name}" disabled="disabled" name="name" required lay-verify="required"  autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">Email</label>
                            <div class="layui-input-inline">
                                <input type="text" th:value="${user.email}" disabled="disabled" name="email" required lay-verify="required"  autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">电话</label>
                            <div class="layui-input-inline">
                                <input type="text" th:value="${user.phone}" disabled="disabled" name="price" required lay-verify="required"  autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item" id="passDiv" style="display: none">
                            <label class="layui-form-label">旧密码</label>
                            <div class="layui-input-inline">
                                <input type="password" name="oldPass" required lay-verify="required" placeholder="请输入旧密码" autocomplete="off" class="layui-input">
                            </div>
                            <label class="layui-form-label">新密码</label>
                            <div class="layui-input-inline">
                                <input type="text" name="newPass" required lay-verify="required" placeholder="请输入新密码" autocomplete="off" class="layui-input">
                            </div>
                            <label class="layui-form-label">确认新密码</label>
                            <div class="layui-input-inline">
                                <input type="text" name="Pass" required lay-verify="required" placeholder="请输入确认密码" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item"></div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="formDemo">修改用户</button>
                                <button class="layui-btn" id="editPass" >修改密码</button>
                            </div>
                        </div>
                    </form>
                </div>
            </fieldset>
        </div>
    </div>
    <div th:replace="inc/foot :: div"></div>

</div>
<script>
    //JavaScript代码区域
    layui.use('element', function () {
        var element = layui.element;
    });


    var layer;
    layui.use('layer', function(){
        layer = layui.layer;
    });
</script>
<script type="text/javascript">
    $(function () {
        $('#menu a').each(function () {
            var aText = $(this).text();
            if ('个人信息' == aText) {
                $(this).parent('dd').addClass('layui-this');
            }
        });

        $('#editPass').on('click',function () {
            $('#passDiv').css('display','inline');
            $('#editPass').html('确认修改密码');
            $('#formId').attr('action','/admin/user/editPass');
        });

    });



</script>
<script th:inline="javascript">
    /*<![CDATA[*/

    var info = /*[[${info}]]*/ 'Sebastian';

    /*]]>*/
    if(info != null && info != ''){
        alert(info);
    }
</script>
</body>

</html>